good coding practices here

also integrating controller logic