Fixed code complexity and avoid duplications in instance_methods