Code is divided

The code was devided to header file and source file to be more clear.