reorganised and cleaned up some layout