modularizing more / building more functions