Clean up code and remove logCall