Moved functionality to respective files. Created server wrapper