Moved actual code to pages