cleaned code structure