removed boilerplate
made things more logical?