simple code refactory