Cleaned up framework-init, commented and restyled code