bugfixes, layout improvements and cleaned up code