cleaned code so it is more consistent