Code rearranging

Comments added. Interfaces moved to core class.