refactored code and added function stubs
update