improved layout and code styling