Improved layout, added interfaces and well commented the code