diff --git a/include/sched.hh b/include/sched.hh
index dd4d6055803497b35075336c5534bbea0ad30ddd..4fd11074bf48fd49425400604969367980e2f364 100644
--- a/include/sched.hh
+++ b/include/sched.hh
@@ -22,6 +22,8 @@ namespace sched {
 
 class thread;
 class cpu;
+class timer;
+class timer_list;
 
 void schedule(bool yield = false);
 
@@ -31,6 +33,21 @@ extern "C" {
 
 namespace bi = boost::intrusive;
 
+class timer : public bi::set_base_hook<> {
+public:
+    explicit timer(thread& t);
+    ~timer();
+    void set(u64 time);
+    bool expired() const;
+    void cancel();
+    friend bool operator<(const timer& t1, const timer& t2);
+private:
+    thread& _t;
+    bool _expired;
+    u64 _time;
+    friend class timer_list;
+};
+
 class thread {
 public:
     struct stack_info {
@@ -86,6 +103,15 @@ public:
     bi::list_member_hook<> _thread_list_link;
 };
 
+class timer_list : private clock_event_callback {
+public:
+    timer_list();
+    virtual void fired();
+private:
+    friend class timer;
+    bi::set<timer, bi::base_hook<bi::set_base_hook<>>> _list;
+};
+
 typedef bi::list<thread,
                  bi::member_hook<thread,
                                  bi::list_member_hook<>,
@@ -108,32 +134,6 @@ struct cpu {
 
 thread* current();
 
-class timer;
-
-class timer_list : private clock_event_callback {
-public:
-    timer_list();
-    virtual void fired();
-private:
-    friend class timer;
-    bi::set<timer, bi::base_hook<bi::set_base_hook<>>> _list;
-};
-
-class timer : public bi::set_base_hook<> {
-public:
-    explicit timer(thread& t);
-    ~timer();
-    void set(u64 time);
-    bool expired() const;
-    void cancel();
-    friend bool operator<(const timer& t1, const timer& t2);
-private:
-    thread& _t;
-    bool _expired;
-    u64 _time;
-    friend class timer_list;
-};
-
 class wait_guard {
 public:
     wait_guard(thread* t) : _t(t) { t->prepare_wait(); }