Cleaned up code + behaviour.