Cleaned init function