Cleaned up init code