Added Log Manager and improved overall code